<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<title>动作管理</title>
<script>
	$(function(){
		/*列表初始化*/
		var gridParam = {"columns":[[
              {"field":"motionCode","width":120,"title":"动作编码",sortable:true},
              {"field":"motionName","width":120,"title":"动作名称"},
              {"field":"motionIcon","width":120,"title":"动作css"},
              {"field":"motionIcon_","width":120,"title":"动作预览",formatter: function(value,row,index){
            	  return '<span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">'+ row.motionName  +'</span><span class="l-btn-icon '+ row.motionIcon  +'">&nbsp;</span></span>';
              }},
              {"field":"motionOrder","width":120,"title":"动作排序"}
		 	]],
		 	queryParams:{
		 		sort:'motionOrder',
		 		order:'desc'
		 	}
		};
		p.dataGrid = $(p.dataGrid).datagrid( $.extend({}, p.dataGridParam, gridParam));

		/*事件响应*/
		$("#toolbar .easyui-linkbutton").on("click", function() {
			var motion_code = $(this).attr("motion_code");p.btnOneClick($(this));
			switch (motion_code) {
				case "01":
					p.gridAdd({ title : "动作新增", width : 400, height : 300 });
					break;
				case "02":
					p.gridModify({title : "动作编辑" ,width : 400, height : 300 });
					break;
				case "03":
					p.gridDelete();
					break;
				case "05":
					p.gridQuery();
					break;
				default: 
					p.tip({msg: $(this).text() +'未添加响应事件！'}); break;
			}
		});
	});
</script>
</head>
<body class="easyui-layout">
	<!-- 但行高度33px，多行时 33乘以行数  -->
	<div id="querybar" data-options="region:'north',split:false,border:false" style="height:33px;">
		<div class="easyui-panel" data-options="fit:true,border:false">
			<!-- 查询条件表单，根据配置进行替换  -->
			<form id="queryForm" >
			 <input type="hidden" name="className" value="com.fs.base.pojo.Motion" />
			 <div style="margin-top:5px;margin-left:10px;float:left;">
			  <input class="easyui-textbox" name="motionCode" style="width:240px;" data-options="label:'动作编码:'" />
			  <input type="hidden" name="motionCode_searchType" value="like" />
			 </div>
			 <div style="margin-top:5px;margin-left:10px;float:left;">
			  <input class="easyui-textbox" name="motionName" style="width:240px;" data-options="label:'动作名称:'" />
			  <input type="hidden" name="motionName_searchType" value="like" />
			 </div>
			</form>
		</div>
	</div>  

	<!-- 工具栏按钮 -->
	<div id="toolbar" class="easyui-panel" style="padding:3px;"> </div>
	
	<!-- 表格 -->
	<div region="center" border="false">
		<table id="dataGrid"></table>
	</div>
</body>
</html>